package com.matrix.yukun.matrix.main_module.utils;

import android.graphics.Rect;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

/**
 * Created by yukun on 17-7-5.
 */

public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
    private int top;
    private int left;
    private int right;
    private int bottom;


    public SpacesItemDecoration(int top, int left, int right, int bottom) {
        this.top = top;
        this.left = left;
        this.right = right;
        this.bottom = bottom;

    }

    public SpacesItemDecoration(int devide) {
        this.top = devide;
        this.left = devide;
        this.right = devide;
        this.bottom = devide;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view,
                               RecyclerView parent, RecyclerView.State state) {
        outRect.right = right;
        outRect.top = top;
        outRect.left = left;
        outRect.bottom = bottom;
    }

}
